home *** CD-ROM | disk | FTP | other *** search
-
- function units_mortar_alien_setup()
- units_setup(4,true,ENET_EFFECT_PS_SETUPSMOKE_MEDIUM,ENET_EFFECT_GEOMETRY_MORTARALIENSHADOW)
- end
-
- function units_mortar_alien_resetup()
- units_setup(4,true,nil,ENET_EFFECT_GEOMETRY_MORTARALIENSHADOW)
- end
-
- function units_mortar_alien_select()
- units_select(22,2)
- end
-
- function units_mortar_alien_unselect()
- units_unselect()
- end
-
- function units_mortar_alien_selectenemy()
- uniGetExecutor():addSimpleEffect(ENET_EFFECT_SELECTEDGEOMETRY_ENEMY)
- end
-
- function units_mortar_alien_damaged()
- uniGetExecutor():applyDamage(uniGetLife())
- end
-
- function units_mortar_alien_highlight()
- uniGetExecutor():addEffectWithRadius(ENET_EFFECT_GEOMETRY_HIGHLIGHT,15)
- end
-
- function units_mortar_alien_explode()
- units_explode_small3_green()
- end
-
- function units_mortar_alien_move()
- local unit = uniGetExecutor()
- local sound = unit:play3DSound("mortar_alien_move.wav",1)
- local steps = {}
- local i = 0;
- for i = 0,1 do
- steps[i] = unit:getBone(ENBT_STEPEMITTER,i):addSimpleEffect(ENET_EFFECT_DYNAMICGEOMETRY_LIGHTTANKSTEPSEMITTER)
- steps[i+2] = unit:getBone(ENBT_STEPEMITTER,i):addSimpleEffect(ENET_EFFECT_PS_NEWTRACKSMOKE3)
- end
- waitDeath(unit:addRotationEffect(ENET_EFFECT_ROTATE_UNIT,MATH_PI * 1.0))
- waitDeath(unit:addMoveEffect(ENET_EFFECT_MOVE_LINEAR,100))
- sound:destroy()
- unit:play3DSound("mortar_alien_stop.wav",0):destroy()
- for i = 0,1 do
- if(unit:getScale() < 1.0) then
- steps[i]:destroy()
- else
- steps[i]:setTransformOwner()
- steps[i]:suspendedDestroy(70)
- end
- steps[i+2]:suspendedDestroy(1.0)
- end
- end
-
- function units_mortar_alien_fire()
- local unit = uniGetExecutor()
- local gt = unit:getBone(ENBT_GUNTOWER)
- -- local sound = gt:play3DSound("mortar_guntower_rotate.wav",1)
- gt:play3DSound("mortar_guntower_rotate.wav",0)
- waitDeath(gt:addRotationEffect(ENET_EFFECT_ROTATE_GUNTOWERTOTARGET,MATH_PI,uniGetTarget()))
- local firespot = gt:getBone(ENBT_FIRE1)
- local shot = firespot:addBulletEffect(ENET_EFFECT_BULLET_SPAWNEDPLAZMABALL)
- local shot2 = shot:addSimpleEffect(ENET_EFFECT_PS_MORTARSPARKLES)
- shot:executeCommand(ENC_FIRE1)
- local gun = gt:getBone(ENBT_GUN)
- waitDeath(gun:addRotationEffect(ENET_EFFECT_ROTATE_GUNTOTARGET_GRAVITYPARABOLA,MATH_PI / 3.0,uniGetTarget()))
- -- sound:stopSound()
- pause(1.5)
- gt:play3DSound("mortar_guntower_rotate.wav",0)
- gun:addRotationEffect(ENET_EFFECT_ROTATE_GUNTOWERDEFAULT,MATH_PI / 3.0)
- gt:addRotationEffect(ENET_EFFECT_ROTATE_GUNTOWERDEFAULT,MATH_PI)
- unit:addFireArrow()
- end
-
- registerCommand(ENSCRIPTSET_MORTAR_ALIEN,ENC_MOVE,"units_mortar_alien_move")
- registerCommand(ENSCRIPTSET_MORTAR_ALIEN,ENC_FIRE1,"units_mortar_alien_fire")
- registerCommand(ENSCRIPTSET_MORTAR_ALIEN,ENC_FIRE2,"units_mortar_alien_fire")
- registerCommand(ENSCRIPTSET_MORTAR_ALIEN,ENC_SELECT,"units_mortar_alien_select")
- registerCommand(ENSCRIPTSET_MORTAR_ALIEN,ENC_SELECTENEMY,"units_mortar_alien_selectenemy")
- registerCommand(ENSCRIPTSET_MORTAR_ALIEN,ENC_UNSELECT,"units_mortar_alien_unselect")
- registerCommand(ENSCRIPTSET_MORTAR_ALIEN,ENC_SETUP,"units_mortar_alien_setup")
- registerCommand(ENSCRIPTSET_MORTAR_ALIEN,ENC_RESETUP,"units_mortar_alien_resetup")
- registerCommand(ENSCRIPTSET_MORTAR_ALIEN,ENC_DAMAGED,"units_mortar_alien_damaged")
- registerCommand(ENSCRIPTSET_MORTAR_ALIEN,ENC_EXPLODE,"units_mortar_alien_explode")
- registerCommand(ENSCRIPTSET_MORTAR_ALIEN,ENC_HIGHLIGHT,"units_mortar_alien_highlight")
- registerCommand(ENSCRIPTSET_MORTAR_ALIEN,ENC_INSIDE,"units_inside")
-
- -- make description of unit
- desc = getEffectDescriptionP(ENET_UNIT_MORTAR_ALIEN)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "mortar_alien.rmd"
- desc.ScriptSet = ENSCRIPTSET_MORTAR_ALIEN
- desc.MoveType = ENMOVE_GROUNDORIENTED
- desc.RenderType = ENRENDERTYPE_GEOMETRY
- desc.Material = ENMAT_RIGIDSKINNEDMESH
- desc.MaterialColors = units_materialcolors_human
-
- -- shadow
- desc = getEffectDescriptionP(ENET_EFFECT_GEOMETRY_MORTARALIENSHADOW)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "mortar_alien_shadow.rmd"
- desc.RenderType = ENRENDERTYPE_SHADOW
- desc.Material = ENMAT_SHADOW
- desc.MaterialColors = units_materialcolors_shadow
-
- -- register new unit to logic
- unitDesc = logic_getUnitDescP(17)
- unitDesc.group = 0
- unitDesc.order = 2
- unitDesc.unit_res_id = ENET_UNIT_MORTAR_ALIEN
- unitDesc.unit_icon_id = "Mortar_a_small_normal.dds"
- unitDesc.active_id = "Mortar_a_small_active.dds"
- unitDesc.pressed_id = "Mortar_a_small_pressed.dds"
- unitDesc.big_icon_id = "Mortar_a_big_normal.dds"
- unitDesc.small_icon_id = "Mortar_l_stats.dds"
- unitDesc.HP = 4
- unitDesc.MP = 10
- unitDesc.WR = 2
- unitDesc.min_WR = 1
- unitDesc.WD = 2
- unitDesc.WR2 = 0
- unitDesc.min_WR2 = 0
- unitDesc.WD2 = 0
- unitDesc.ability = 0
- unitDesc.transport = 0
- unitDesc.value = 2
- unitDesc.race = 1
- unitDesc.fire_pause = 1.0
- unitDesc.move_pause = 0.7
- unitDesc.unit_info_scale = 0.06
- unitDesc.scn_name = "MORTARA"
-
- ------------------------------------------------------------------------------------------------------
- ------------------------ effects related to unit------------------------------------------------------
- ------------------------------------------------------------------------------------------------------
-
- function bullets_plazmaballalien_fire()
- local bullet = uniGetExecutor()
- local light = bullet:addSimpleEffect(ENET_EFFECT_LIGHT_SPAWNEDPLAZMABALLFLY)
- -- local sound = bullet:play3DSound("mortar_alien_cannon_fire.wav",1)
- bullet:play3DSound("mortar_alien_cannon_fire.wav",0)
- local track = bullet:addSimpleEffect(ENET_EFFECT_PS_PLAZMABALLSPAWNING)
- pause(1.35)
- bullet:setTransformOwner()
- waitDeath(bullet:addMoveEffect(ENET_EFFECT_MOVE_GRAVITYPARABOLA,150,uniGetTarget()))
- -- sound:destroy()
- light:destroy()
- track:suspendedDestroy(1.0)
- bullet:play3DSound("mortar_alien_cannon_explode.wav",0):destroy()
- local exp1 = bullet:addSimpleEffect(ENET_EFFECT_PS_SPAWNEDPLAZMABALLHIT)
- pause(0.1)
- bullet:addSimpleEffect(ENET_EFFECT_LIGHT_SPAWNEDPLAZMABALLHIT):delayedDestroy(1.0)
- local exp = bullet:addSimpleEffect(ENET_EFFECT_PS_SPHEREOFLIGHTNINGS)
- pause(0.3)
- exp:suspendedDestroy(1.0)
- exp1:suspendedDestroy(1.0)
- uniGetTarget():executeCommand(ENC_DAMAGED)
- pause(1.0)
- bullet:destroy()
- end
-
- registerCommand(ENSCRIPTSET_BULLET_SPAWNEDPLAZMABALL,ENC_FIRE1,"bullets_plazmaballalien_fire")
-